#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
#endregion

namespace KLib.Physics
{
    public class GeometryFactory
    {
        #region Fields

        #endregion

        #region Properties

        #endregion

        #region Initialization

        public GeometryFactory()
        {

        }

        #endregion

        #region Methods
        public static void CreateRectangleGeometry(RigidBody body, float width, float height)
        {
            CreateRectangleGeometry(body, width, height, 0);
        }
        public static void CreateRectangleGeometry(RigidBody body, float width, float height, float mass)
        {
            body.Geometry.Add(new KLib.Physics.Collisions.Geom(body, KLib.Physics.Collisions.Vertices.CreateRectangle(width, height)));
            body.Mass += mass;
            body.MomentOfInertia += mass * (width * height + height * height) / 12;
        }


        public static void CreateCircleGeometry(RigidBody body, float radius, int vertexCount)
        {
            CreateCircleGeometry(body, radius, vertexCount, 0);
        }

        public static void CreateCircleGeometry(RigidBody body, float radius, int vertexCount, float mass)
        {
            body.Geometry.Add(new KLib.Physics.Collisions.Geom(body, KLib.Physics.Collisions.Vertices.CreateCircle(radius, vertexCount)));
            body.Mass += mass;
            body.MomentOfInertia += 0.5f * mass * radius * radius;
        }
        #endregion

        #region Helper Methods

        #endregion
    }
}
